package com.bootdo.analyze.controller;

import com.bootdo.analyze.dao.ClientSellAIDao;
import com.bootdo.analyze.domain.ClientSellAIDO;
import com.bootdo.analyze.domain.GoodsSellAIDO;
import com.bootdo.analyze.service.ClientSellAIService;
import com.bootdo.analyze.service.GoodsSellAIService;
import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.Query;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * 客户AI分析
 * 
 * @author chglee
 * @email 1992lcg@163.com
 * @date 2020-03-02 10:02:27
 */
 
@Controller
@RequestMapping("/analyze/client")
public class ClientSellAIController {
	@Autowired
	private ClientSellAIService clientSellAIService;


	/**
	 * 客户销售分析
	 * @return
	 */
	@GetMapping("/clientfluctuate")
	@RequiresPermissions("analyze:clientsellFluctuate:clientfluctuate")
	String clientFluctuate(){
		return "analyze/clientsellFluctuate/clientfluctuate";
	}

	@ResponseBody
	@GetMapping("/clientfluctuatelist")
	@RequiresPermissions("analyze:clientsellFluctuate:clientfluctuate")
	public PageUtils clienlist(@RequestParam Map<String, Object> params){
		//查询列表数据
		Query query = new Query(params);
		List<ClientSellAIDO> goodsList = clientSellAIService.getClientFluctuate(query);
		int total = clientSellAIService.count(query);
		PageUtils pageUtils = new PageUtils(goodsList, total);
		return pageUtils;
	}

	@GetMapping("/clientfluctuatereport")
	String sellclientReportShows(){
		return "analyze/clientsellFluctuate/fluctuatereport";
	}


	

	
}
